package top.lixunda.ecommerce.server.auth.api.feign;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import top.lixunda.ecommerce.server.auth.api.entity.cache.CacheAuthCode;
import top.lixunda.ecommerce.server.auth.api.entity.dto.PhoneCodeDTO;
import top.lixunda.commerce.common.core.config.FeignConfig;
import top.lixunda.commerce.common.core.constants.ServiceIds;
import top.lixunda.common.validate.XumValid;

/**
 * 手机验证码发送服务
 *
 * @author Xumda
 * @version time:2019/11/22 16:47
 */
@Api("手机验证码发送服务")
@FeignClient(value = ServiceIds.AUTH_SERVER, configuration = FeignConfig.class)
@RequestMapping("/feign/auth/code/phone")
public interface IFeignPhoneAuthCode {

    /**
     * 发送验证信息
     *
     * @param phoneCodeDTO 短信验证码信息DTO
     * @return 保存发送的验证码信息DTO
     */
    @ApiOperation("发送验证信息")
    @PostMapping("sendRegisterCode")
    CacheAuthCode sendRegisterCode(@RequestBody @XumValid PhoneCodeDTO phoneCodeDTO);

}
